package com.xiaolun.other;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo09 {
	public static void main(String[] args) {
		encodingDemo();
	}

	private static void encodingDemo() {
		String separator = File.separator;
		File file = new File("D:" + separator + "test" + separator + "test3.txt");
		FileOutputStream out = null;
		try {
			out = new FileOutputStream(file);
			out.write("hello,world---->你好，世界".getBytes("ISO8859-1"));
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				out.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
